<%@page import="java.util.List"%>
<%@ page import="com.mod.Article"%>
<%@page import="com.mod.Blogger"%>
<%@ page import="com.servlet.ArcitleServverImpl"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!doctype html>
<html lang="en">
<head>
<title>个人博客</title>
<!-- Required meta tags -->
 <%@ include file="include/rsouce.jsp" %>
<link href="css/style.css" rel="stylesheet">
</head>
<body>
	<div class="container-fluid">
		 <%@ include file="include/header.jsp" %>
		<div class="row">
			<div class="col=12">
				<img src="img\2.JPG" class="img-fluid  " alt="">
			</div>

		</div>
		</br>
		<div class="row">
			<div class="col-sm-8">
			<%
				Blogger blogger1 = (Blogger) session.getAttribute("blogger");
				if (blogger != null) {
					//登录
					
				%>
				<a type="button" class="btn btn-primary" href="articlemanagement.html?m=create">添加</a>
				<%
				}
				%>
				<%-- 博文列表 --%>
				<%
					Object obj = request.getAttribute("List");
						if (obj!=null){
							List<Article> list = (List<Article>) obj;
							
							//循环读取数据进行业务处理
							for (Article a:list) {
								 //根据下标从List集合中获取对象
				%>
				</br>
				<div class="card">
					<div class="card-body">
						<a href="" target="_blank">
							<h5 class="card-title">
						
								<%=a.getTitle()%>&nbsp;
							</h5>
							<p class="card-text"><%=a.getContent()%>
							</p>
						</a>
						<div style="margin-top: 10px;">
							<span class="align-middle" style="color: #ccc;">发布时间：<%=a.getIsReleased()%></span> <a
								href="#" target="_blank" class="btn btn-primary float-right">阅读全文</a>
								<%
								if (blogger!=null){
								%>
								<button type="button" class="btn btn-success">修改</button>
								<button type="button" class="btn btn-danger">删除</button>
								<%
								}
								%>
						</div>
					</div>
				</div>
				<%
					}
					}
				%> 
			</div>
			
			<div class="col-sm-4">
				<%-- 博文分类标签 --%>
				</br>
				<ul class="list-group">
					<li
						class="list-group-item d-flex justify-content-between align-items-center">
						最新动态 <span class="badge badge-primary badge-pill">10</span>
					</li>
					<li
						class="list-group-item d-flex justify-content-between align-items-center">
						Dapibus ac facilisis in <span
						class="badge badge-primary badge-pill">4</span>
					</li>
					<li
						class="list-group-item d-flex justify-content-between align-items-center">
						Morbi leo risus <span class="badge badge-primary badge-pill">1</span>
					</li>
				</ul>
			</div>
		</div>
		<div class="row" style="margin: 20px 0px;">
			<div class="col">
				<p class="text-center">&copy;2018&nbsp;&nbsp;&nbsp;
					L-H科技&nbsp;&nbsp;&nbsp;软件开发工作室&nbsp;&nbsp;&nbsp;周浪</p>
			</div>
		</div>

	</div>
</body>
</html>